
const state = {
    totalCount: 0,
    // 基本资料
    todoData: null,
    approveData: null,
    formData: {},
    applyType: null
}

const actions = {
    setTodoData(todoData) {
        this.applyType = todoData.applyType;
        const formData = todoData.formData;
        if (formData) {
            this.formData = formData;
        } else {
            this.formData = {};
        }
        this.todoData = todoData;
    },
    getApplyType() {
        return this.applyType;
    },
    getFormData() {
        return this.formData;
    },
    // 获取用户列表
    getTodoData() {
        return this.todoData;
    },
    setApproveData(data) {
        this.approveData = data;
    }
}

const useStore = defineStore('todo', {
    state: () => state,
    actions: actions
});

export default useStore
